package com.example.hms.controller;
import com.example.hms.entity.Live;
import com.example.hms.entity.Stay;
import com.example.hms.service.StayService;
import com.example.hms.ulit.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
@RequestMapping("/stay")
public class StayController {
    // 使用Resource注解注入StayService依赖
    @Resource
    private StayService stayService;
    @RequestMapping(value = "selectAllStay", method = RequestMethod.GET)
    public Result selectAllStay(Stay stay)  {
        return stayService.selectAllStay(stay);
    }
    @RequestMapping(value = "/insertStay",method = RequestMethod.GET)
    public Result insertStay(Live live){
        return stayService.insertStay(live);
    }
    @RequestMapping(value = "/cancelStay",method = RequestMethod.GET)
    public Result cancelStay(Live live){
        return stayService.cancelStay(live);
    }
    @RequestMapping(value = "/abrogateStay",method = RequestMethod.GET)
    public Result abrogateStay(Live live){
        return stayService.abrogateStay(live);
    }

}
